return hold;
}
-function UserListItem(user, reason) {
- this._init(user, reason);
-}
+const UserListItem = new Lang.Class({
+ Name: 'UserListItem',
-UserListItem.prototype = {
_init: function(user) {
this.user = user;
this._userChangedId = this.user.connect('changed',
});
return hold;
}
-
-};
+});
Signals.addSignalMethods(UserListItem.prototype);
-function UserList() {
- this._init.apply(this, arguments);
-}
+const UserList = new Lang.Class({
+ Name: 'UserList',
-UserList.prototype = {
_init: function() {
this.actor = new St.ScrollView({ style_class: 'login-dialog-user-list-view'});
this.actor.set_policy(Gtk.PolicyType.NEVER,
item.actor.destroy();
delete this._items[userName];
}
-};
+});
Signals.addSignalMethods(UserList.prototype);
-function SessionListItem(id, name) {
- this._init(id, name);
-}
+const SessionListItem = new Lang.Class({
+ Name: 'SessionListItem',
-SessionListItem.prototype = {
_init: function(id, name) {
this.id = id;
_onClicked: function() {
this.emit('activate');
}
-};
+});
Signals.addSignalMethods(SessionListItem.prototype);
-function SessionList() {
- this._init();
-}
+const SessionList = new Lang.Class({
+ Name: 'SessionList',
-SessionList.prototype = {
_init: function() {
this.actor = new St.Bin();
}));
}
}
-};
+});
Signals.addSignalMethods(SessionList.prototype);
-function LoginDialog() {
- if (_loginDialog == null) {
- this._init();
- _loginDialog = this;
- }
-
- return _loginDialog;
-}
-
const LoginDialog = new Lang.Class({
Name: 'LoginDialog',
Extends: ModalDialog.ModalDialog,
const THUMBNAIL_ICON_MARGIN = 2;
-function DocInfo(recentInfo) {
- this._init(recentInfo);
-}
+const DocInfo = new Lang.Class({
+ Name: 'DocInfo',
-DocInfo.prototype = {
_init : function(recentInfo) {
this.recentInfo = recentInfo;
// We actually used get_modified() instead of get_visited()
}
return mtype;
}
-};
+});
var docManagerInstance = null;
/**
* DocManager wraps the DocSystem, primarily to expose DocInfo objects.
*/
-function DocManager() {
- this._init();
-}
+const DocManager = new Lang.Class({
+ Name: 'DocManager',
-DocManager.prototype = {
_init: function() {
this._docSystem = Shell.DocSystem.get_default();
this._infosByTimestamp = [];
return this._infosByUri[url];
})), terms);
}
-};
+});
Signals.addSignalMethods(DocManager.prototype);
const DEFAULT_LIMIT = 512;
-function HistoryManager(params) {
- this._init(params);
-}
+const HistoryManager = new Lang.Class({
+ Name: 'HistoryManager',
-HistoryManager.prototype = {
_init: function(params) {
params = Params.parse(params, { gsettingsKey: null,
limit: DEFAULT_LIMIT,
if (this._key)
global.settings.set_strv(this._key, this._history);
}
-};
+});
Signals.addSignalMethods(HistoryManager.prototype);
return _providersTable = providers;
}
-function ModemGsm() {
- this._init.apply(this, arguments);
-}
+const ModemGsm = new Lang.Class({
+ Name: 'ModemGsm',
-ModemGsm.prototype = {
_init: function(path) {
this._proxy = new ModemGsmNetworkProxy(Gio.DBus.system, 'org.freedesktop.ModemManager', path);
return name3 || name2 || null;
}
-}
+});
Signals.addSignalMethods(ModemGsm.prototype);
-function ModemCdma() {
- this._init.apply(this, arguments);
-}
+const ModemCdma = new Lang.Class({
+ Name: 'ModemCdma',
-ModemCdma.prototype = {
_init: function(path) {
this._proxy = new ModemCdmaProxy(Gio.DBus.system, 'org.freedesktop.ModemManager', path);
return null;
}
-};
+});
Signals.addSignalMethods(ModemCdma.prototype);
return primary;
}
-function AltTabPopup() {
- this._init();
-}
+const AltTabPopup = new Lang.Class({
+ Name: 'AltTabPopup',
-AltTabPopup.prototype = {
_init : function() {
this.actor = new Shell.GenericContainer({ name: 'altTabPopup',
reactive: true,
onComplete: Lang.bind(this, function () { this.thumbnailsVisible = true; })
});
}
-};
+});
const SwitcherList = new Lang.Class({
Name: 'SwitcherList',
Signals.addSignalMethods(SwitcherList.prototype);
-function AppIcon(app) {
- this._init(app);
-}
+const AppIcon = new Lang.Class({
+ Name: 'AppIcon',
-AppIcon.prototype = {
_init: function(app) {
this.app = app;
this.actor = new St.BoxLayout({ style_class: 'alt-tab-app',
this._iconBin.set_size(size, size);
this._iconBin.child = this.icon;
}
-};
+});
const AppSwitcher = new Lang.Class({
Name: 'AppSwitcher',
const MENU_POPUP_TIMEOUT = 600;
const SCROLL_TIME = 0.1;
-function AlphabeticalView() {
- this._init();
-}
+const AlphabeticalView = new Lang.Class({
+ Name: 'AlphabeticalView',
-AlphabeticalView.prototype = {
_init: function() {
this._grid = new IconGrid.IconGrid({ xAlign: St.Align.START });
this._appSystem = Shell.AppSystem.get_default();
this._addApp(app);
}
}
-};
+});
-function ViewByCategories() {
- this._init();
-}
+const ViewByCategories = new Lang.Class({
+ Name: 'ViewByCategories',
-ViewByCategories.prototype = {
_init: function() {
this._appSystem = Shell.AppSystem.get_default();
this.actor = new St.BoxLayout({ style_class: 'all-app' });
this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
}
}
-};
+});
/* This class represents a display containing a collection of application items.
* The applications are sorted based on their name.
*/
-function AllAppDisplay() {
- this._init();
-}
+const AllAppDisplay = new Lang.Class({
+ Name: 'AllAppDisplay',
-AllAppDisplay.prototype = {
_init: function() {
this._appSystem = Shell.AppSystem.get_default();
this._appSystem.connect('installed-changed', Lang.bind(this, function() {
_redisplay: function() {
this._appView.refresh();
}
-};
+});
const AppSearchProvider = new Lang.Class({
Name: 'AppSearchProvider',
}
});
-function AppWellIcon(app, iconParams, onActivateOverride) {
- this._init(app, iconParams, onActivateOverride);
-}
+const AppWellIcon = new Lang.Class({
+ Name: 'AppWellIcon',
-AppWellIcon.prototype = {
_init : function(app, iconParams, onActivateOverride) {
this.app = app;
this.actor = new St.Button({ style_class: 'app-well-app',
getDragActorSource: function() {
return this.icon.icon;
}
-};
+});
Signals.addSignalMethods(AppWellIcon.prototype);
const AppIconMenu = new Lang.Class({
const Main = imports.ui.main;
-function AppFavorites() {
- this._init();
-}
+const AppFavorites = new Lang.Class({
+ Name: 'AppFavorites',
-AppFavorites.prototype = {
FAVORITE_APPS_KEY: 'favorite-apps',
_init: function() {
this._addFavorite(appId, pos);
}));
}
-};
+});
Signals.addSignalMethods(AppFavorites.prototype);
var appFavoritesInstance = null;
return self;
}
-function AutomountManager() {
- this._init();
-}
+const AutomountManager = new Lang.Class({
+ Name: 'AutomountManager',
-AutomountManager.prototype = {
_init: function() {
this._settings = new Gio.Settings({ schema: SETTINGS_SCHEMA });
this._volumeQueue = [];
return false;
});
}
-}
+});
'/org/gnome/Shell/HotplugSniffer');
}
-function ContentTypeDiscoverer(callback) {
- this._init(callback);
-}
+const ContentTypeDiscoverer = new Lang.Class({
+ Name: 'ContentTypeDiscoverer',
-ContentTypeDiscoverer.prototype = {
_init: function(callback) {
this._callback = callback;
},
this._callback(mount, apps, contentTypes);
}
-}
+});
-function AutorunManager() {
- this._init();
-}
+const AutorunManager = new Lang.Class({
+ Name: 'AutorunManager',
-AutorunManager.prototype = {
_init: function() {
this._volumeMonitor = Gio.VolumeMonitor.get();
+ ': ' + e.toString());
}
},
-}
+});
const AutorunResidentSource = new Lang.Class({
Name: 'AutorunResidentSource',
},
});
-function AutorunTransientDispatcher() {
- this._init();
-}
+const AutorunTransientDispatcher = new Lang.Class({
+ Name: 'AutorunTransientDispatcher',
-AutorunTransientDispatcher.prototype = {
_init: function() {
this._sources = [];
this._settings = new Gio.Settings({ schema: SETTINGS_SCHEMA });
// destroy the notification source
source.destroy();
}
-}
+});
const AutorunTransientSource = new Lang.Class({
Name: 'AutorunTransientSource',
* placed. The arrow position may be controlled via setArrowOrigin().
*
*/
-function BoxPointer(side, binProperties) {
- this._init(side, binProperties);
-}
+const BoxPointer = new Lang.Class({
+ Name: 'BoxPointer',
-BoxPointer.prototype = {
_init: function(arrowSide, binProperties) {
this._arrowSide = arrowSide;
this._arrowOrigin = 0;
get opacity() {
return this.actor.opacity;
}
-};
+});
// Abstraction for an appointment/event in a calendar
-function CalendarEvent(date, end, summary, allDay) {
- this._init(date, end, summary, allDay);
-}
+const CalendarEvent = new Lang.Class({
+ Name: 'CalendarEvent',
-CalendarEvent.prototype = {
_init: function(date, end, summary, allDay) {
this.date = date;
this.end = end;
this.summary = summary;
this.allDay = allDay;
}
-};
+});
// Interface for appointments/events - e.g. the contents of a calendar
//
// First, an implementation with no events
-function EmptyEventSource() {
- this._init();
-}
+const EmptyEventSource = new Lang.Class({
+ Name: 'EmptyEventSource',
-EmptyEventSource.prototype = {
_init: function() {
},
hasEvents: function(day) {
return false;
}
-};
+});
Signals.addSignalMethods(EmptyEventSource.prototype);
const CalendarServerIface = <interface name="org.gnome.Shell.CalendarServer">
return self;
}
-// an implementation that reads data from a session bus service
-function DBusEventSource() {
- this._init();
-}
-
function _datesEqual(a, b) {
if (a < b)
return false;
return true;
}
+// an implementation that reads data from a session bus service
+const DBusEventSource = new Lang.Class({
+ Name: 'DBusEventSource',
-DBusEventSource.prototype = {
_init: function() {
this._resetCache();
return true;
}
-};
+});
Signals.addSignalMethods(DBusEventSource.prototype);
// Calendar:
// @eventSource: is an object implementing the EventSource API, e.g. the
// requestRange(), getEvents(), hasEvents() methods and the ::changed signal.
-function Calendar(eventSource) {
- this._init(eventSource);
-}
+const Calendar = new Lang.Class({
+ Name: 'Calendar',
-Calendar.prototype = {
_init: function(eventSource) {
if (eventSource) {
this._eventSource = eventSource;
if (this._eventSource)
this._eventSource.requestRange(beginDate, iter, forceReload);
}
-};
+});
Signals.addSignalMethods(Calendar.prototype);
-function EventsList(eventSource) {
- this._init(eventSource);
-}
+const EventsList = new Lang.Class({
+ Name: 'EventsList',
-EventsList.prototype = {
_init: function(eventSource) {
this.actor = new St.BoxLayout({ vertical: true, style_class: 'events-header-vbox'});
this._date = new Date();
this._showOtherDay(this._date);
}
}
-};
+});
/* This class represents a shown contact search result in the overview */
-function Contact(id) {
- this._init(id);
-}
+const Contact = new Lang.Class({
+ Name: 'Contact',
-Contact.prototype = {
_init: function(id) {
this._contactSys = Shell.ContactSystem.get_default();
this.individual = this._contactSys.get_individual(id);
return tc.load_icon_name(null, 'avatar-default', St.IconType.FULLCOLOR, size);
}
},
-};
+});
/* Searches for and returns contacts */
BOTTOM: 2
};
-function CtrlAltTabManager() {
- this._init();
-}
+const CtrlAltTabManager = new Lang.Class({
+ Name: 'CtrlAltTabManager',
-CtrlAltTabManager.prototype = {
_init: function() {
this._items = [];
this._focusManager = St.FocusManager.get_for_stage(global.stage);
}));
}
}
-};
+});
function mod(a, b) {
return (a + b) % b;
}
-function CtrlAltTabPopup() {
- this._init();
-}
+const CtrlAltTabPopup = new Lang.Class({
+ Name: 'CtrlAltTabPopup',
-CtrlAltTabPopup.prototype = {
_init : function() {
this.actor = new Shell.GenericContainer({ name: 'ctrlAltTabPopup',
reactive: true });
this._selection = num;
this._switcher.highlight(num);
}
-};
+});
const CtrlAltTabSwitcher = new Lang.Class({
Name: 'CtrlAltTabSwitcher',
}
});
-function Dash() {
- this._init();
-}
+const Dash = new Lang.Class({
+ Name: 'Dash',
-Dash.prototype = {
_init : function() {
this._maxHeight = -1;
this.iconSize = 64;
return true;
}
-};
+});
Signals.addSignalMethods(Dash.prototype);
}
}
-function _Draggable(actor, params) {
- this._init(actor, params);
-}
+const _Draggable = new Lang.Class({
+ Name: 'Draggable',
-_Draggable.prototype = {
_init : function(actor, params) {
params = Params.parse(params, { manualMode: false,
restoreOnSuccess: false,
this._dragActor = undefined;
currentDraggable = null;
}
-};
+});
Signals.addSignalMethods(_Draggable.prototype);
return app;
}
-function ListItem(app, reason) {
- this._init(app, reason);
-}
+const ListItem = new Lang.Class({
+ Name: 'ListItem',
-ListItem.prototype = {
_init: function(app, reason) {
this._app = app;
this._reason = reason;
this.emit('activate');
this._app.activate();
}
-};
+});
Signals.addSignalMethods(ListItem.prototype);
// The logout timer only shows updates every 10 seconds
}
});
-function IconGrid(params) {
- this._init(params);
-}
+const IconGrid = new Lang.Class({
+ Name: 'IconGrid',
-IconGrid.prototype = {
_init: function(params) {
params = Params.parse(params, { rowLimit: null,
columnLimit: null,
visibleItemsCount: function() {
return this._grid.get_children().length - this._grid.get_n_skip_paint();
}
-};
+});
<property name='Name' access='read' type='s' />
</interface>;
-function Key() {
- this._init.apply(this, arguments);
-}
+const Key = new Lang.Class({
+ Name: 'Key',
-Key.prototype = {
_init : function(key) {
this._key = key;
this._boxPointer.hide(true);
}
}
-};
+});
-function Keyboard() {
- this._init.apply(this, arguments);
-}
+const Keyboard = new Lang.Class({
+ // HACK: we can't set Name, because it collides with Name dbus property
+ // Name: 'Keyboard',
-Keyboard.prototype = {
_init: function () {
this._impl = Gio.DBusExportedObject.wrapJSObject(CaribouKeyboardIface, this);
this._impl.export(Gio.DBus.session, '/org/gnome/Caribou/Keyboard');
get Name() {
return 'gnome-shell';
}
-};
+});
const KeyboardSource = new Lang.Class({
Name: 'KeyboardSource',
const STARTUP_ANIMATION_TIME = 0.2;
const KEYBOARD_ANIMATION_TIME = 0.5;
-function LayoutManager() {
- this._init.apply(this, arguments);
-}
+const LayoutManager = new Lang.Class({
+ Name: 'LayoutManager',
-LayoutManager.prototype = {
_init: function () {
this._rtl = (St.Widget.get_default_direction() == St.TextDirection.RTL);
this.monitors = [];
findMonitorForActor: function(actor) {
return this._chrome.findMonitorForActor(actor);
}
-};
+});
Signals.addSignalMethods(LayoutManager.prototype);
//
// This class manages a "hot corner" that can toggle switching to
// overview.
-function HotCorner() {
- this._init();
-}
+const HotCorner = new Lang.Class({
+ Name: 'HotCorner',
-HotCorner.prototype = {
_init : function() {
// We use this flag to mark the case where the user has entered the
// hot corner and has not left both the hot corner and a surrounding
return true;
return false;
}
-};
+});
// This manages the shell "chrome"; the UI that's visible in the
affectsInputRegion: true
};
-function Chrome() {
- this._init.apply(this, arguments);
-}
+const Chrome = new Lang.Class({
+ Name: 'Chrome',
-Chrome.prototype = {
_init: function(layoutManager) {
this._layoutManager = layoutManager;
return false;
}
-};
+});
* @container and will track any changes in its size. You can override
* this by passing an explicit width and height in @params.
*/
-function Lightbox(container, params) {
- this._init(container, params);
-}
+const Lightbox = new Lang.Class({
+ Name: 'Lightbox',
-Lightbox.prototype = {
_init : function(container, params) {
params = Params.parse(params, { inhibitEvents: false,
width: null,
this.highlight(null);
}
-};
+});
return keywords.concat(windowProperties).concat(headerProperties);
}
-function AutoComplete(entry) {
- this._init(entry);
-}
+const AutoComplete = new Lang.Class({
+ Name: 'AutoComplete',
-AutoComplete.prototype = {
_init: function(entry) {
this._entry = entry;
this._entry.connect('key-press-event', Lang.bind(this, this._entryKeyPressEvent));
this._entry.clutter_text.insert_text(additionalCompletionText, cursorPos);
}
-};
+});
Signals.addSignalMethods(AutoComplete.prototype);
-function Notebook() {
- this._init();
-}
+const Notebook = new Lang.Class({
+ Name: 'Notebook',
-Notebook.prototype = {
_init: function() {
this.actor = new St.BoxLayout({ vertical: true });
this.selectIndex(prevIndex);
}
-};
+});
Signals.addSignalMethods(Notebook.prototype);
function objectToString(o) {
}
});
-function Result(command, o, index) {
- this._init(command, o, index);
-}
+const Result = new Lang.Class({
+ Name: 'Result',
-Result.prototype = {
_init : function(command, o, index) {
this.index = index;
this.o = o;
padBin.add_actor(line);
this.actor.add(padBin);
}
-};
+});
-function WindowList() {
- this._init();
-}
+const WindowList = new Lang.Class({
+ Name: 'WindowList',
-WindowList.prototype = {
_init : function () {
this.actor = new St.BoxLayout({ name: 'Windows', vertical: true, style: 'spacing: 8px' });
let tracker = Shell.WindowTracker.get_default();
}
}
}
-};
+});
Signals.addSignalMethods(WindowList.prototype);
-function ObjInspector() {
- this._init();
-}
+const ObjInspector = new Lang.Class({
+ Name: 'ObjInspector',
-ObjInspector.prototype = {
_init : function () {
this._obj = null;
this._previousObj = null;
_onBack: function() {
this.selectObject(this._previousObj, true);
}
-};
+});
function addBorderPaintHook(actor) {
let signalId = actor.connect_after('paint',
return signalId;
}
-function Inspector() {
- this._init();
-}
+const Inspector = new Lang.Class({
+ Name: 'Inspector',
-Inspector.prototype = {
_init: function() {
let container = new Shell.GenericContainer({ width: 0,
height: 0 });
this._borderPaintId = addBorderPaintHook(this._target);
}
}
-};
+});
Signals.addSignalMethods(Inspector.prototype);
-function ErrorLog() {
- this._init();
-}
+const ErrorLog = new Lang.Class({
+ Name: 'ErrorLog',
-ErrorLog.prototype = {
_init: function() {
this.actor = new St.BoxLayout();
this.text = new St.Label();
}
this.text.text = text;
}
-};
+});
-function Memory() {
- this._init();
-}
+const Memory = new Lang.Class({
+ Name: 'Memory',
-Memory.prototype = {
_init: function() {
this.actor = new St.BoxLayout({ vertical: true });
this._glibc_uordblks = new St.Label();
this._gjs_closure.text = 'gjs_closure: ' + memInfo.gjs_closure;
this._last_gc_seconds_ago.text = 'last_gc_seconds_ago: ' + memInfo.last_gc_seconds_ago;
}
-};
+});
-function Extensions() {
- this._init();
-}
+const Extensions = new Lang.Class({
+ Name: 'Extensions',
-Extensions.prototype = {
_init: function() {
this.actor = new St.BoxLayout({ vertical: true,
name: 'lookingGlassExtensions' });
return box;
}
-};
+});
-function LookingGlass() {
- this._init();
-}
+const LookingGlass = new Lang.Class({
+ Name: 'LookingGlass',
-LookingGlass.prototype = {
_init : function() {
this._borderPaintTarget = null;
this._borderPaintId = 0;
})
});
}
-};
+});
Signals.addSignalMethods(LookingGlass.prototype);
let magDBusService = null;
-function Magnifier() {
- this._init();
-}
+const Magnifier = new Lang.Class({
+ Name: 'Magnifier',
-Magnifier.prototype = {
_init: function() {
// Magnifier is a manager of ZoomRegions.
this._zoomRegions = [];
);
}
}
-};
+});
Signals.addSignalMethods(Magnifier.prototype);
-function ZoomRegion(magnifier, mouseSourceActor) {
- this._init(magnifier, mouseSourceActor);
-}
+const ZoomRegion = new Lang.Class({
+ Name: 'ZoomRegion',
-ZoomRegion.prototype = {
_init: function(magnifier, mouseSourceActor) {
this._magnifier = magnifier;
yMagMouse - groupHeight / 2);
}
}
-};
+});
-function Crosshairs() {
- this._init();
-}
+const Crosshairs = new Lang.Class({
+ Name: 'Crosshairs',
-Crosshairs.prototype = {
_init: function() {
// Set the group containing the crosshairs to three times the desktop
this._vertTopHair.set_position((groupWidth - thickness) / 2, top);
this._vertBottomHair.set_position((groupWidth - thickness) / 2, bottom);
}
-};
+});
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Gio = imports.gi.Gio;
+const Lang = imports.lang;
const Main = imports.ui.main;
const MAG_SERVICE_NAME = 'org.gnome.Magnifier';
// '/org/gnome/Magnifier/ZoomRegion/zoomer1', etc.
let _zoomRegionInstanceCount = 0;
-function ShellMagnifier() {
- this._init();
-}
+const ShellMagnifier = new Lang.Class({
+ Name: 'ShellMagnifier',
-ShellMagnifier.prototype = {
_init: function() {
this._zoomers = {};
// Drop the leading '#'.
return parseInt(colorString.slice(1), 16);
}
-};
+});
/**
* ShellMagnifierZoomRegion:
* @zoomerObjectPath: String that is the path to a DBus ZoomRegion.
* @zoomRegion: The actual zoom region associated with the object path.
*/
-function ShellMagnifierZoomRegion(zoomerObjectPath, zoomRegion) {
- this._init(zoomerObjectPath, zoomRegion);
-}
+const ShellMagnifierZoomRegion = new Lang.Class({
+ Name: 'ShellMagnifierZoomRegion',
-ShellMagnifierZoomRegion.prototype = {
_init: function(zoomerObjectPath, zoomRegion) {
this._zoomRegion = zoomRegion;
destroy: function() {
this._dbusImpl.unexport();
}
-};
+});
return GLib.markup_escape_text(text, -1);
}
-function URLHighlighter(text, lineWrap, allowMarkup) {
- this._init(text, lineWrap, allowMarkup);
-}
+const URLHighlighter = new Lang.Class({
+ Name: 'URLHighlighter',
-URLHighlighter.prototype = {
_init: function(text, lineWrap, allowMarkup) {
if (!text)
text = '';
}
return -1;
}
-};
+});
-function FocusGrabber() {
- this._init();
-}
+const FocusGrabber = new Lang.Class({
+ Name: 'FocusGrabber',
-FocusGrabber.prototype = {
_init: function() {
this.actor = null;
this._togglingFocusGrabMode = false;
}
}
-}
+});
Signals.addSignalMethods(FocusGrabber.prototype);
// Notification:
});
Signals.addSignalMethods(Source.prototype);
-function SummaryItem(source) {
- this._init(source);
-}
+const SummaryItem = new Lang.Class({
+ Name: 'SummaryItem',
-SummaryItem.prototype = {
_init: function(source) {
this.source = source;
this.source.connect('notification-added', Lang.bind(this, this._notificationAddedToSource));
if (this.notificationStack.get_children().length > 0)
this.notificationStack.get_children()[0]._delegate.setIconVisible(true);
}
-};
+});
Signals.addSignalMethods(SummaryItem.prototype);
-function MessageTray() {
- this._init();
-}
+const MessageTray = new Lang.Class({
+ Name: 'MessageTray',
-MessageTray.prototype = {
_init: function() {
this._presence = new GnomeSession.Presence(Lang.bind(this, function(proxy, error) {
this._onStatusChanged(proxy.status);
if (this._clickedSummaryItem)
this._updateState();
}
-};
+});
const SystemNotificationSource = new Lang.Class({
Name: 'SystemNotificationSource',
}
});
-function NetworkAgent() {
- this._init.apply(this, arguments);
-}
+const NetworkAgent = new Lang.Class({
+ Name: 'NetworkAgent',
-NetworkAgent.prototype = {
_init: function() {
this._native = new Shell.NetworkAgent({ auto_register: true,
identifier: 'org.gnome.Shell.NetworkAgent' });
this._dialogs[requestId].close(global.get_current_time());
this._dialogs[requestId].destroy();
}
-};
+});
]
};
-function NotificationDaemon() {
- this._init();
-}
+const NotificationDaemon = new Lang.Class({
+ Name: 'NotificationDaemon',
-NotificationDaemon.prototype = {
_init: function() {
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(NotificationDaemonIface, this);
this._dbusImpl.export(Gio.DBus.session, '/org/freedesktop/Notifications');
if (source)
source.destroy();
}
-};
+});
const Source = new Lang.Class({
Name: 'NotificationDaemonSource',
CLICK: 2
};
-function ShellInfo() {
- this._init();
-}
+const ShellInfo = new Lang.Class({
+ Name: 'ShellInfo',
-ShellInfo.prototype = {
_init: function() {
this._source = null;
this._undoCallback = null;
this._source.notify(notification);
}
-};
+});
-function Overview() {
- this._init.apply(this, arguments);
-}
+const Overview = new Lang.Class({
+ Name: 'Overview',
-Overview.prototype = {
_init : function(params) {
params = Params.parse(params, { isDummy: false });
this._needsFakePointerEvent = false;
}
}
-};
+});
Signals.addSignalMethods(Overview.prototype);
};
-function AnimatedIcon(name, size) {
- this._init(name, size);
-}
+const AnimatedIcon = new Lang.Class({
+ Name: 'AnimatedIcon',
-AnimatedIcon.prototype = {
_init: function(name, size) {
this.actor = new St.Bin({ visible: false });
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
if (this._timeoutId)
Mainloop.source_remove(this._timeoutId);
}
-};
+});
-function TextShadower() {
- this._init();
-}
+const TextShadower = new Lang.Class({
+ Name: 'TextShadower',
-TextShadower.prototype = {
_init: function() {
this.actor = new Shell.GenericContainer();
this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
child.allocate(childBox, flags);
}
}
-};
+});
/**
* AppMenuButton:
Mainloop.source_remove(this._xdndTimeOut);
this._xdndTimeOut = 0;
}
-})
+});
-function PanelCorner(panel, side) {
- this._init(panel, side);
-}
+const PanelCorner = new Lang.Class({
+ Name: 'PanelCorner',
-PanelCorner.prototype = {
_init: function(box, side) {
this._side = side;
this.actor.set_size(cornerRadius, innerBorderWidth + cornerRadius);
this.actor.set_anchor_point(0, innerBorderWidth);
}
-};
+});
-function Panel() {
- this._init();
-}
+const Panel = new Lang.Class({
+ Name: 'Panel',
-Panel.prototype = {
_init : function() {
this.actor = new Shell.GenericContainer({ name: 'panel',
reactive: true });
if (box && box._delegate instanceof PanelMenu.ButtonBox)
box.destroy();
},
-
-};
+});
}
});
-function PlacesManager() {
- this._init();
-}
+const PlacesManager = new Lang.Class({
+ Name: 'PlacesManager',
-PlacesManager.prototype = {
_init: function() {
this._defaultPlaces = [];
this._mounts = [];
_removeById: function(sourceArray, id) {
sourceArray.splice(this._lookupIndexById(sourceArray, id), 1);
}
-};
+});
Signals.addSignalMethods(PlacesManager.prototype);
const PlaceSearchProvider = new Lang.Class({
});
Signals.addSignalMethods(AuthenticationDialog.prototype);
-function AuthenticationAgent() {
- this._init();
-}
+const AuthenticationAgent = new Lang.Class({
+ Name: 'AuthenticationAgent',
-AuthenticationAgent.prototype = {
_init: function() {
this._native = new Shell.PolkitAuthenticationAgent();
this._native.connect('initiate', Lang.bind(this, this._onInitiate));
this._reallyCompleteRequest(wasDismissed);
}
}
-}
+});
function init() {
let agent = new AuthenticationAgent();
this.toggle();
}
- PopupBaseMenuItem.prototype.activate.call(this, event);
+ this.parent(event);
},
toggle: function() {
const DIALOG_GROW_TIME = 0.1;
-function CommandCompleter() {
- this._init();
-}
+const CommandCompleter = new Lang.Class({
+ Name: 'CommandCompleter',
-CommandCompleter.prototype = {
_init : function() {
this._changedCount = 0;
this._paths = GLib.getenv('PATH').split(':');
return common.substr(text.length);
return common;
}
-};
+});
const RunDialog = new Lang.Class({
Name: 'RunDialog',
});
Signals.addSignalMethods(SearchProvider.prototype);
-function OpenSearchSystem() {
- this._init();
-}
+const OpenSearchSystem = new Lang.Class({
+ Name: 'OpenSearchSystem',
-OpenSearchSystem.prototype = {
_init: function() {
this._providers = [];
global.settings.connect('changed::' + DISABLED_OPEN_SEARCH_PROVIDERS_KEY, Lang.bind(this, this._refresh));
}
}));
}
-}
+});
Signals.addSignalMethods(OpenSearchSystem.prototype);
-function SearchSystem() {
- this._init();
-}
+const SearchSystem = new Lang.Class({
+ Name: 'SearchSystem',
-SearchSystem.prototype = {
_init: function() {
this._providers = [];
this.reset();
this._previousResults = results;
this.emit('search-completed', results);
},
-};
+});
Signals.addSignalMethods(SearchSystem.prototype);
const MAX_SEARCH_RESULTS_ROWS = 1;
-function SearchResult(provider, metaInfo, terms) {
- this._init(provider, metaInfo, terms);
-}
+const SearchResult = new Lang.Class({
+ Name: 'SearchResult',
-SearchResult.prototype = {
_init: function(provider, metaInfo, terms) {
this.provider = provider;
this.metaInfo = metaInfo;
else
this.provider.activateResult(this.metaInfo.id, params);
}
-};
+});
const GridSearchResults = new Lang.Class({
}
});
-function SearchResults(searchSystem, openSearchSystem) {
- this._init(searchSystem, openSearchSystem);
-}
+const SearchResults = new Lang.Class({
+ Name: 'SearchResults',
-SearchResults.prototype = {
_init: function(searchSystem, openSearchSystem) {
this._searchSystem = searchSystem;
this._searchSystem.connect('search-updated', Lang.bind(this, this._updateCurrentResults));
resultDisplay.activateSelected();
Main.overview.hide();
}
-};
+});
</signal>
</interface>;
-function GnomeShell() {
- this._init();
-}
+const GnomeShell = new Lang.Class({
+ Name: 'GnomeShellDBus',
-GnomeShell.prototype = {
_init: function() {
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(GnomeShellIface, this);
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/Shell');
this._dbusImpl.emit_signal('ExtensionStatusChanged',
GLib.Variant.new('(sis)', [newState.uuid, newState.state, newState.error]));
}
-};
+});
/* -------------------------------------------------------- */
-function ListItem(app) {
- this._init(app);
-}
+const ListItem = new Lang.Class({
+ Name: 'ListItem',
-ListItem.prototype = {
_init: function(app) {
this._app = app;
this.emit('activate');
this._app.activate();
}
-};
+});
Signals.addSignalMethods(ListItem.prototype);
-function ShellMountOperation(source, params) {
- this._init(source, params);
-}
+const ShellMountOperation = new Lang.Class({
+ Name: 'ShellMountOperation',
-ShellMountOperation.prototype = {
_init: function(source, params) {
params = Params.parse(params, { reaskPassword: false });
this._processesDialog.update(message, processes, choices);
},
-}
+});
const ShellMountQuestionDialog = new Lang.Class({
Name: 'ShellMountQuestionDialog',
}
}));
- MessageTray.Source.prototype.notify.call(this, notification);
+ this.parent(notification);
},
createNotificationIcon: function() {
},
grabFocus: function(lockTray) {
- MessageTray.Notification.prototype.grabFocus.call(this, lockTray);
+ this.parent(lockTray);
global.stage.set_key_focus(this._entry);
}
});
'ibus-ui-gtk': 'input-method'
};
-function StatusIconDispatcher() {
- this._init();
-}
+const StatusIconDispatcher = new Lang.Class({
+ Name: 'StatusIconDispatcher',
-StatusIconDispatcher.prototype = {
_init: function() {
this._traymanager = new Shell.TrayManager();
this._traymanager.connect('tray-icon-added', Lang.bind(this, this._onTrayIconAdded));
else
this.emit('message-icon-removed', icon);
}
-};
+});
Signals.addSignalMethods(StatusIconDispatcher.prototype);
};
}
-function Client() {
- this._init();
-};
+const Client = new Lang.Class({
+ Name: 'Client',
-Client.prototype = {
_init : function() {
// channel path -> ChatSource
this._chatSources = {};
return this._accountSource;
}
-};
+});
const ChatSource = new Lang.Class({
Name: 'ChatSource',
},
notify: function() {
- MessageTray.Source.prototype.notify.call(this, this._notification);
+ this.parent(this._notification);
},
respond: function(text) {
this._invalidId = 0;
}
- MessageTray.Source.prototype.destroy.call(this);
+ this.parent();
},
createNotificationIcon: function() {
// time updates; even better is to pay attention to the vertical
// vblank and sync to that when possible.)
//
-function ClutterFrameTicker() {
- this._init();
-}
+const ClutterFrameTicker = new Lang.Class({
+ Name: 'ClutterFrameTicker',
-ClutterFrameTicker.prototype = {
FRAME_RATE : 60,
_init : function() {
this._startTime = -1;
global.end_work();
}
-};
+});
Signals.addSignalMethods(ClutterFrameTicker.prototype);
});
-function ViewSelector() {
- this._init();
-}
+const ViewSelector = new Lang.Class({
+ Name: 'ViewSelector',
-ViewSelector.prototype = {
_init : function() {
this.actor = new St.BoxLayout({ name: 'viewSelector',
vertical: true });
removeSearchProvider: function(provider) {
this._searchTab.removeSearchProvider(provider);
}
-};
+});
Signals.addSignalMethods(ViewSelector.prototype);
const Main = imports.ui.main;
const MessageTray = imports.ui.messageTray;
-function WindowAttentionHandler() {
- this._init();
-}
+const WindowAttentionHandler = new Lang.Class({
+ Name: 'WindowAttentionHandler',
-WindowAttentionHandler.prototype = {
_init : function() {
this._tracker = Shell.WindowTracker.get_default();
global.display.connect('window-demands-attention', Lang.bind(this, this._onWindowDemandsAttention));
notification.update(title, banner);
})));
}
-};
+});
const Source = new Lang.Class({
Name: 'WindowAttentionSource',
return outerRect.y - inputRect.y;
}
-function WindowDimmer(actor) {
- this._init(actor);
-}
+const WindowDimmer = new Lang.Class({
+ Name: 'WindowDimmer',
-WindowDimmer.prototype = {
_init: function(actor) {
if (Clutter.feature_available(Clutter.FeatureFlags.SHADERS_GLSL)) {
this._effect = new Clutter.ShaderEffect({ shader_type: Clutter.ShaderType.FRAGMENT_SHADER });
},
_dimFraction: 0.0
-};
+});
function getWindowDimmer(actor) {
if (!actor._windowDimmer)
return actor._windowDimmer;
}
-function WindowManager() {
- this._init();
-}
+const WindowManager = new Lang.Class({
+ Name: 'WindowManager',
-WindowManager.prototype = {
_init : function() {
this._shellwm = global.window_manager;
if (!Main.overview.visible)
this._workspaceSwitcherPopup.display(WorkspaceSwitcherPopup.DOWN, indexToActivate);
}
-};
+});
}
-function ScaledPoint(x, y, scaleX, scaleY) {
- [this.x, this.y, this.scaleX, this.scaleY] = arguments;
-}
+const ScaledPoint = new Lang.Class({
+ Name: 'ScaledPoint',
+
+ _init: function(x, y, scaleX, scaleY) {
+ [this.x, this.y, this.scaleX, this.scaleY] = arguments;
+ },
-ScaledPoint.prototype = {
getPosition : function() {
return [this.x, this.y];
},
return [_interpolate(this.scaleX, other.scaleX, step),
_interpolate(this.scaleY, other.scaleY, step)];
}
-};
+});
-function WindowClone(realWindow) {
- this._init(realWindow);
-}
+const WindowClone = new Lang.Class({
+ Name: 'WindowClone',
-WindowClone.prototype = {
_init : function(realWindow) {
this.realWindow = realWindow;
this.metaWindow = realWindow.meta_window;
this.emit('drag-end');
}
-};
+});
Signals.addSignalMethods(WindowClone.prototype);
* @parentActor: The actor which will be the parent of all overlay items
* such as app icon and window caption
*/
-function WindowOverlay(windowClone, parentActor) {
- this._init(windowClone, parentActor);
-}
+const WindowOverlay = new Lang.Class({
+ Name: 'WindowOverlay',
-WindowOverlay.prototype = {
_init : function(windowClone, parentActor) {
let metaWindow = windowClone.metaWindow;
this._parentActor.queue_relayout();
}
-};
+});
Signals.addSignalMethods(WindowOverlay.prototype);
const WindowPositionFlags = {
/**
* @metaWorkspace: a #Meta.Workspace, or null
*/
-function Workspace(metaWorkspace, monitorIndex) {
- this._init(metaWorkspace, monitorIndex);
-}
+const Workspace = new Lang.Class({
+ Name: 'Workspace',
-Workspace.prototype = {
_init : function(metaWorkspace, monitorIndex) {
// When dragging a window, we use this slot for reserve space.
this._reservedSlot = null;
return false;
}
-};
+});
Signals.addSignalMethods(Workspace.prototype);
const UP = -1;
const DOWN = 1;
-function WorkspaceSwitcherPopup() {
- this._init();
-}
+const WorkspaceSwitcherPopup = new Lang.Class({
+ Name: 'WorkspaceSwitcherPopup',
-WorkspaceSwitcherPopup.prototype = {
_init : function() {
this.actor = new St.Group({ reactive: true,
x: 0,
onCompleteScope: this
});
}
-};
+});
// placeholder exactly.
const WORKSPACE_CUT_SIZE = 10;
-function WindowClone(realWindow) {
- this._init(realWindow);
-}
+const WindowClone = new Lang.Class({
+ Name: 'WindowClone',
-WindowClone.prototype = {
_init : function(realWindow) {
this.actor = new Clutter.Clone({ source: realWindow.get_texture(),
reactive: true });
this.emit('drag-end');
}
-};
+});
Signals.addSignalMethods(WindowClone.prototype);
/**
* @metaWorkspace: a #Meta.Workspace
*/
-function WorkspaceThumbnail(metaWorkspace) {
- this._init(metaWorkspace);
-}
+const WorkspaceThumbnail = new Lang.Class({
+ Name: 'WorkspaceThumbnail',
-WorkspaceThumbnail.prototype = {
_init : function(metaWorkspace) {
this.metaWorkspace = metaWorkspace;
this.monitorIndex = Main.layoutManager.primaryIndex;
return false;
}
-};
+});
Signals.addSignalMethods(WorkspaceThumbnail.prototype);
-function ThumbnailsBox() {
- this._init();
-}
+const ThumbnailsBox = new Lang.Class({
+ Name: 'ThumbnailsBox',
-ThumbnailsBox.prototype = {
_init: function() {
this.actor = new Shell.GenericContainer({ style_class: 'workspace-thumbnails',
request_mode: Clutter.RequestMode.WIDTH_FOR_HEIGHT });
onCompleteScope: this
});
}
-};
+});
const CONTROLS_POP_IN_TIME = 0.1;
-function WorkspacesView(workspaces) {
- this._init(workspaces);
-}
+const WorkspacesView = new Lang.Class({
+ Name: 'WorkspacesView',
-WorkspacesView.prototype = {
_init: function(workspaces) {
this.actor = new St.Group({ style_class: 'workspaces-view' });
_getWorkspaceIndexToRemove: function() {
return global.screen.get_active_workspace_index();
}
-};
+});
Signals.addSignalMethods(WorkspacesView.prototype);
-function WorkspacesDisplay() {
- this._init();
-}
+const WorkspacesDisplay = new Lang.Class({
+ Name: 'WorkspacesDisplay',
-WorkspacesDisplay.prototype = {
_init: function() {
this.actor = new Shell.GenericContainer();
this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
break;
}
}
-};
+});
Signals.addSignalMethods(WorkspacesDisplay.prototype);
const Signals = imports.signals;
const DND = imports.ui.dnd;
-function XdndHandler() {
- this._init();
-}
+const XdndHandler = new Lang.Class({
+ Name: 'XdndHandler',
-XdndHandler.prototype = {
_init: function() {
// Used to display a clone of the cursor window when the
// window group is hidden (like it happens in the overview)
pickedActor = pickedActor.get_parent();
}
}
-}
+});
Signals.addSignalMethods(XdndHandler.prototype);